﻿<UserControl x:Class="Ewav.AberrationControl"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:GadgetSelector="clr-namespace:Ewav.ContextMenu;assembly=Ewav.ContextMenu.Menu"
	xmlns:Common="clr-namespace:CommonLibrary;assembly=CommonLibrary"
	mc:Ignorable="d"
	d:DesignHeight="600" d:DesignWidth="600"
	xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
	DataContext="{Binding Source={StaticResource Locator}, Path=AberrationViewModel}" >

	<UserControl.Resources>

		<Style x:Key="HeaderCell" TargetType="Rectangle">
			<Setter Property="Stroke" Value="#FFC4C4C4"/>
			<Setter Property="StrokeThickness" Value="0.4"/>
			<Setter Property="Fill" Value="#FFE5F2D9"/>
			<Setter Property="VerticalAlignment" Value="Top"/>
			<Setter Property="HorizontalAlignment" Value="Stretch"/>
		</Style>
		<Style x:Key="TextBlockStyle1" TargetType="TextBlock">
			<Setter Property="FontWeight" Value="Bold"/>
			<Setter Property="FontFamily" Value="Segoe UI"/>
			<Setter Property="FontSize" Value="12"/>
			<Setter Property="Margin" Value="4"/>
		</Style>

	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" Background="White" MouseRightButtonDown="LayoutRoot_MouseRightButtonDown" 
		  MouseLeftButtonDown="LayoutRoot_MouseLeftButtonDown">




		<Grid x:Name="GadgetWindow" Background="White" MinWidth="500" >
			<Grid.RowDefinitions>
        		<RowDefinition Height="50"/>
        		<RowDefinition/>
        	</Grid.RowDefinitions>
        	<Grid.ColumnDefinitions>
        		<ColumnDefinition Width="Auto"/>
        		<ColumnDefinition/>
        	</Grid.ColumnDefinitions>
			<Rectangle x:Name="GWindow" Style="{StaticResource GWindow}" Grid.RowSpan="2" Stroke="{StaticResource WindowBrush}" StrokeThickness="4" Grid.ColumnSpan="2" />
			<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment, GridBox" Margin="13,11,0,0">
                <TextBlock x:Name="tbChartName" TextWrapping="Wrap" Text="Aberration Detection" VerticalAlignment="Top" Margin="0,0,26,0" Height="Auto" HorizontalAlignment="Left" Foreground="#FF2B4360" FontSize="21.333"/>

				<Rectangle x:Name="GHeader" VerticalAlignment="Top" Height="4" Margin="0,2,0,0" StrokeThickness="0" Fill="#FF00B050" />	
			</StackPanel>
			<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" d:LayoutOverrides="Height" VerticalAlignment="Top" Margin="180,9,10,0" Grid.Column="1">
				<Button x:Name="FilterButton" Content="" Template="{StaticResource FilterButton}" Cursor="Hand" Click="FilterButton_Click" Width="24" Height="24" IsEnabled="False" >
					<Button.Effect>
						<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
					</Button.Effect>
				</Button>
				<Button x:Name="HeaderButton" Content="" Template="{StaticResource HeaderButton}" Cursor="Hand" Click="HeaderButton_Click"  Width="24" Height="24" IsEnabled="False">
					<Button.Effect>
						<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
					</Button.Effect>
				</Button>
				<Button x:Name="ResizeButton" Content="" Template="{StaticResource resizebtn}" Cursor="Hand" Click="ResizeButton_Click" Width="24" Height="24" >
					<Button.Effect>
						<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
					</Button.Effect>
				</Button>
				<Button x:Name="CloseButton" Content="" Template="{StaticResource CloseButton}" Cursor="Hand" Click="CloseButton_Click" Width="24" Height="24" >
					<Button.Effect>
						<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
					</Button.Effect>
				</Button>
			</StackPanel>
			<Grid x:Name="GadgetContentGrid" Margin="0,5,0,0" MinHeight="30" Grid.Row="1" Grid.ColumnSpan="2">
				<toolkit:Expander Margin="0,-45,131,10" 
				ExpandDirection="Down" IsExpanded="False" Style="{StaticResource ExpanderStyle2}" Canvas.ZIndex="999" HorizontalAlignment="Right" Width="188" x:Name="gadgetExpander" VerticalAlignment="Top">

					<toolkit:Expander.Header>
						<TextBlock Text="Edit Properties" FontFamily="Segoe UI" Cursor="Hand" FontSize="13.333" Foreground="#FFFFFCFC"/>
					</toolkit:Expander.Header>
					<Grid Background="#FF5C53AC" Margin="0,-2,1,0" Width="178">
						<StackPanel Margin="2,0,2,3" VerticalAlignment="Top" HorizontalAlignment="Center" Width="163">
                            
							<TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Date:" Margin="0,5,0,0" Foreground="White"  />
							<ComboBox x:Name="cbxDate" Width="162" HorizontalAlignment="Left" SelectedIndex="0" />
							<TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Indicator (Optional):" Margin="0,5,0,0" Foreground="White"  />
							<ComboBox x:Name="cbxSyndrome" Width="162" HorizontalAlignment="Left" SelectedIndex="0" />
							<TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Count (Optional):" Margin="0,5,0,0" Foreground="White"  />
							<ComboBox x:Name="cbxFieldWeight" Width="162" HorizontalAlignment="Left" SelectedIndex="0" />
							
							<TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Lag time (days):" Margin="0,5,0,0" Foreground="White"  />
                            <TextBox x:Name="txtLagTime" Grid.Column="2" Grid.Row="5" Width="30" HorizontalAlignment="Left" Text="7" Margin="0, 0, 0, 00" TextChanged="txtLagTime_TextChanged" ></TextBox> <!--PreviewTextInput="NumberBox_PreviewTextInput" TextChanged="txtLagTime_TextChanged"-->
							<TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Threshold (Std. Deviations):" Margin="0,5,0,0" Foreground="White"  />
                            <TextBox x:Name="txtDeviations" Grid.Column="2" Grid.Row="5" Width="30" HorizontalAlignment="Left" Text="3" Margin="0, 0, 0, 00" TextChanged="txtDeviations_TextChanged"></TextBox> <!--PreviewTextInput="NumberBox_PreviewTextInput" TextChanged="txtDeviations_TextChanged"-->
							<Button x:Name="btnRun" Margin="0,15,0,11" Click="btnRun_Click" HorizontalAlignment="Center" Style="{StaticResource btnSec}" Foreground="#D1FFFFFF" Height="28" Width="105">Run Gadget</Button> <!--Click="btnRun_Click"-->
							
						</StackPanel>

					</Grid>
				</toolkit:Expander>

				<StackPanel x:Name="spContent" Orientation="Vertical" Margin="10,6,10,10" VerticalAlignment="Top">
                    <TextBlock x:Name="tbGadgetDescription"  TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top"  d:LayoutOverrides="HorizontalAlignment" MaxWidth="650" Margin="6,0,0,0" />
                    <StackPanel x:Name="pnlStatus" Height="58" MaxHeight="40" Width="Auto" Background="#FFf8d7e2" Visibility="Visible" VerticalAlignment="Top" Margin="0,5">
                        <StackPanel x:Name="pnlStatusTop" Height="2" Width="Auto" Background="#FFe4658e"/>
						<Image x:Name="ErrorIcon" Source="../../Images/error.png" Width="18" Height="18" HorizontalAlignment="Left" Margin="5,1,5,0" VerticalAlignment="Center"/>
						<TextBlock x:Name="txtStatus" Text="Error: Exception occurred." TextWrapping="Wrap" Margin="30,-15,5,5" HorizontalAlignment="Left" FontWeight="Bold" VerticalAlignment="Center"/>
					</StackPanel>
					

					<Grid x:Name="DataContent" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10">
						<TextBlock x:Name="Title" Text="" HorizontalAlignment="Center" Height="20" VerticalAlignment="Top" Margin="0,10,0,5" FontFamily="Segoe UI" FontSize="14" FontWeight="Bold"/>
						<StackPanel x:Name="pnlCharts" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,20,0,0"/>
					</Grid>
				</StackPanel>
				<Grid x:Name="waitCursor" Background="#36C4C4C4" Height="Auto" Visibility="Collapsed">
					<toolkit:BusyIndicator x:Name="BusyIndicator" IsBusy="True" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="100" />
				</Grid>
				
			</Grid>
		</Grid>
		
	</Grid>
</UserControl>

